 function selectALL(){
	 //查询
	var cName=$("#c_name").val();
	var type3=$("#type3").val();//起始时间
	var type4=$("#type4").val();//结束时间
	var start = new Date(type3.replace("-", "/").replace("-", "/"));
	var end = new Date(type4.replace("-", "/").replace("-", "/"));
	if(start>end){
		layer.alert("起始时间不能大于结束时间");
		return;
	}else{
		layui.use('table', function(){
			var table = layui.table;
			table.reload('test', {
				where: { //设定异步数据接口的额外参数，任意设
					/*  type2:type2, */
//					cName:cName,
					type3:type3,
					type4:type4,
				}
			//,page: {
			// curr: 1 //重新从第 1 页开始
			//}
			});
		});	
	}	
}
  
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  //日期
  laydate.render({
    elem: '#type3'
  });
  laydate.render({
    elem: '#type4'
  });
});
function table(type,id){
	  if(type==0){
		  x_admin_show('订单详情','orderDetails.do?type='+type+'&id='+id,600,400)
	  }else {
		  layer.confirm("确认要删除吗，删除后不能恢复", { title: "删除确认" }, function (index) {
            $.post("memberOrderDelete.do?id="+id, function (data) {
            	if(data.type==1){
            		layer.msg("操作成功");
            		setTimeout(function(){
                        //刷新
                        location.reload();
                    },1000);
            	}else{
            		layer.msg("操作失败，请稍后重试！");
            	}

            },"json");
        }); 
	  }

}
$(function(){
	init();
})
function init(){
	layui.use('table', function(){
		  var table = layui.table;
		  table.render({
			  height: 20
		  });
	});	
}

function post(id) {
	layer.prompt({title: '输入快递单号，并确认', formType: 2}, function(text, index){
		layer.close(index);
		layer.confirm("确认发货？", {icon: 3, title: "发货确认"}, function(){
			$.post('memberOrderPost.do?id='+id+"&expressno="+text, function(data) {
				data = JSON.parse(data);
				if(data.type == 1) {
					layer.msg("发货成功！");
					setTimeout(function(){
						location.reload();
					}, 1000);
				} else {
					layer.msg("操作失败，请稍后重试！");
				}
			});
		});
	});
	
}